<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../../vue/vue.js"></script>

</head>

<body>
    <div id="app">
        <table border="1px">
            <thead>
                <th>商品名称</th>
                <th>商品价格</th>
                <th>状态</th>
            </thead>
            <tbody>
                <tr v-for="item in list">
                    <td>{{item.name}} </td>
                    <td>{{item.price | addTip}}</td>
                    <td>{{item.status | abb}}</td>
                </tr>
            </tbody>


        </table>
    </div>

</body>
<script>
   let vm= new Vue({
        el: "#app",
        data(){
            return{
                list: [
                {
                    name: "衣服",
                    price: '100',
                    status: 1,
                },
                {
                    name: "帽子",
                    price: '50',
                    status: 0,
                },
                {
                    name: "鞋子",
                    price: '50',
                    status: 2,
                }
            ]
            }
            
        },
        filters:{
            abb(value){
            if(value==1){
                return "待支付"
            }else if(value==0){
                return "待发货"
            }else if(value==2){
                return "已完成"
            }else{
                 return "请输入0,1,2"
            }
        },
        addTip(val){
            return'￥'+val;
        }
        },
        
        


    })
</script>

</html>